<template>
  <!-- 企业 -->
  <view>
    <scroll-view :lower-threshold="80"
      :refresher-triggered="refreStatus" @refresherrefresh="handleRefre1"
      :refresher-enabled="true" class="swiper-scroll" scroll-y="true"
      @scrolltolower="swiperScrollLower">
        <view>
          <view  style="width: 92%;margin: 0 auto;">
            <view >
              <u-swiper imgMode="scaleToFill" :list="swiperList" height="140" radius="10" indicator indicatorMode="line" circular></u-swiper>
            </view>

            <view class="fenlei rounded-20 pb20">
              <view style="overflow: hidden;padding: 20rpx 0 0;">
                <view v-for="(item, index) in qyhyfl_list" :key='index'  @click="xiaqiye(index,item.id,item.name)" style="text-align: center;width: 20%;float: left;margin-bottom: 20rpx;">
                  <image :src="item.main_image" style="width: 60rpx;height: 60rpx;" mode=""></image>
                  <view style="font-size: 24rpx;color: #000000;line-height: 30rpx;">
                    {{item.name}}
                  </view>
                </view>
              </view>
            </view>
            <view  style="width:100%;margin: 26rpx auto 6rpx;display: flex;background-color: #F8F8F8;padding: 20rpx 0;">
              <view @click="jiage(1)" :class="tui_type==1?'tui_active':'tui_mei'"
                style="flex:1;text-align: center;">
                全部
                <!-- <text class="iconfont icon-xiangxia" style="font-size: 22rpx;"></text> -->
              </view>
              <!-- <view  @click="jiage(2)" :class="['yihang',tui_type==2?'tui_active':'tui_mei']" style="flex:1;text-align: center;">
            {{label2 || '位置'}}<text class="iconfont icon-xiangxia" style="font-size: 22rpx;"></text>
          </view> -->
              <view @click="jiage(3)" :class="tui_type==3?'tui_active':'tui_mei'"
                style="flex:1;text-align: center;">
                <!-- {{qihuo3 || '市场'}} -->
                <text v-if="qihuo3.length<=4">{{qihuo3 || '市场'}}</text>
                <text v-if="qihuo3.length>4">{{qihuo3.slice(0,4)+'...' || '市场'}}</text>
                <text class="iconfont icon-xiangxia" style="font-size: 22rpx;"></text>
              </view>
              <view @click="jiage(5)" :class="tui_type==5?'tui_active':'tui_mei'"
                style="flex:1;text-align: center;">
                <!-- {{qihuo6 || '品类'}} -->
                <text v-if="qihuo6.length<=4">{{qihuo6 || '品类'}}</text>
                <text v-if="qihuo6.length>4">{{qihuo6.slice(0,4)+'...' || '品类'}}</text>
                <text class="iconfont icon-xiangxia" style="font-size: 22rpx;"></text>
              </view>
              <view @click="jiage(4)" :class="tui_type==4?'tui_active':'tui_mei'"
                style="flex:1;text-align: center;">
                <!-- {{qihuo5 || '类型'}} -->
                <text v-if="qihuo5.length<=4">{{qihuo5 || '类型'}}</text>
                <text v-if="qihuo5.length>4">{{qihuo5.slice(0,4)+'...' || '类型'}}</text>
                <text class="iconfont icon-xiangxia" style="font-size: 22rpx;"></text>
              </view>

            </view>
            <view v-for="(item,index) in qiye_list" :key='index'  >
              <view v-if="item.special_manage==1"  style="box-sizing: border-box;padding: 30rpx 30rpx 0;background-color: #FFFFFF;margin-top: 26rpx;border-radius: 16rpx;">
                <view  style="overflow: hidden;" @click="qyxq(item.id,item.special_manage,item.name)">
                  <view style="width: 35%;float: left;position: relative;">
                    <image :src="item.logo_image"
                      style="width: 190rpx;height: 190rpx;display: block;border-radius: 20rpx;left: 0;"
                      mode="aspectFill"></image>
                    <!-- <text
                      style="color: #AF7300;font-size: 22rpx;padding: 6rpx 20rpx;background-color: #EFE0C3;position: absolute;top: 0;left: 0;border-top-left-radius: 10rpx;">
                      {{item.client_position_text}}
                    </text> -->
                  </view>
                  <view style="width: 65%;float: left;padding: 6rpx 0;">
                    <view style="line-height: 40rpx;color: #010101;font-size: 28rpx;margin: 10rpx 0;"
                      class="yihang">
                      {{item.name}}
                    </view>
                    <view style="line-height: 40rpx;color: #010101;;margin: 10rpx 0 0;overflow: hidden;">
                      <text v-for="(a,b) in item.client_position_arr" :key='b' style="background:#81D8D0;border-radius: 10rpx;color: #18A9A5;font-size: 22rpx;padding: 0 10rpx;float: left;margin-right: 10rpx;margin-bottom: 10rpx;">
                        {{a.title || ''}}
                      </text>
                    </view>
                    <view style="line-height: 30rpx;color: #999999;font-size: 26rpx;margin: 10rpx 0 10rpx;"
                      class="yihang">
                      主营：{{item.manage || '暂无主营'}}
                    </view>
                    <view style="line-height: 30rpx;color: #999999;font-size: 26rpx;" class="erhang">
                      <!-- <text class="iconfont icon-dizhi2"
                        style="color: #909193;font-size: 24rpx;"></text> -->
                      入驻市场：
                      <text v-if="item.bazaar.length>0" v-for="(a,b) in item.bazaar" style="margin-left: 6rpx;" :key='index'>
                        {{a.name}}
                      </text>
                      <text v-if="item.bazaar.length<=0">
                        暂无市场
                      </text>
                    </view>
                  </view>
                </view>
                <view style="display: flex;text-align: center;color: #999999;font-size: 22rpx;line-height: 100rpx;">
                  <view style="flex: 2;text-align: left;">
                    浏览量：{{item.views_num || 0}}
                  </view>
                  <view style="flex: 2;text-align: left;">
                    关注数：{{item.attention_num || 0}}人
                  </view>
                  <view style="flex: 2;">
                    联系次数：{{item.contact_num || 0}}次
                  </view>
                  <view @click="lahei(item.id,index)" style="flex: 1;text-align: right;">
                    <text class="iconfont icon-guanbi" style="font-size: 24rpx;"></text>
                  </view>
                </view>
              </view>
              <view v-if="item.special_manage==2" style="box-sizing: border-box;padding: 30rpx 30rpx 0;background-color: #FFFFFF;margin-top: 26rpx;border-radius: 16rpx;">
                <view style="overflow: hidden;" @click="qyxq(item.id,item.special_manage,item.name)">
                  <view style="width: 35%;float: left;">
                    <image :src="item.logo_image"
                      style="width: 190rpx;height: 190rpx;display: block;border-radius: 20rpx;" mode=""></image>
                  </view>
                  <view style="width: 65%;float: left;padding: 6rpx 0;">
                    <view style="line-height: 40rpx;color: #010101;font-size: 32rpx;margin: 10rpx 0;"
                      class="yihang">
                      {{item.name}}
                    </view>
                    <view style="line-height: 40rpx;color: #010101;font-size: 32rpx;margin: 10rpx 0;overflow: hidden;">
                      <text v-for="(a,b) in item.client_position_arr" :key='b' style="background: linear-gradient(0deg, #1fb0ac 0%, #5EC4C2 100%);border-radius: 6rpx;color: #FEFEFE;font-size: 22rpx;padding: 0rpx 10rpx;float: left;margin-right: 10rpx;margin-bottom: 10rpx;">
                        {{a.title || ''}}
                      </text>
                    </view>
                    <view style="overflow: hidden;line-height: 30rpx;margin: 10rpx 0;">
                      <view style="width: 10%;float: left;">
                        <image
                          src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20564%402x.png"
                          style="width: 30rpx;height: 30rpx;" mode=""></image>
                      </view>
                      <view style="color: #333333;font-size: 22rpx;width: 90%;float: left;">
                        {{item.wl_address_text || ''}}
                      </view>
                    </view>
                    <view style="overflow: hidden;line-height: 30rpx;">
                      <view style="width: 10%;float: left;">
                        <image
                          src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20565%402x.png"
                          style="width: 30rpx;height: 30rpx;" mode=""></image>
                      </view>
                      <view style="color: #333333;font-size: 22rpx;width: 90%;float: left;">
                        {{item.wl_main_text || ''}}
                      </view>
                    </view>
                    <view style="line-height: 30rpx;color: #999999;font-size: 22rpx;" class="erhang">
                      <!-- <text class="iconfont icon-dizhi2"
                        style="color: #909193;font-size: 24rpx;"></text> -->
                      入驻市场：
                      <text v-if="item.bazaar.length>0" v-for="(a,b) in item.bazaar" style="margin-left: 6rpx;" :key='index'>
                        {{a.name}}
                      </text>
                      <text v-if="item.bazaar.length<=0">
                        暂无市场
                      </text>
                    </view>
                  </view>
                </view>
                <view style="display: flex;text-align: center;color: #999999;font-size: 22rpx;line-height: 100rpx;">
                  <view style="flex: 2;text-align: left;">
                    浏览量：{{item.views_num}}
                  </view>
                  <view style="flex: 2;text-align: left;">
                    关注数：{{item.contact_num}}人
                  </view>
                  <view style="flex: 2;">
                    联系次数：{{item.attention_num}}次
                  </view>
                  <view @click="lahei(item.id,index)" style="flex: 1;text-align: right;">
                    <text class="iconfont icon-guanbi" style="font-size: 24rpx;"></text>
                  </view>
                </view>
              </view>
              <view v-if="item.special_manage==3"  style="box-sizing: border-box;padding: 30rpx 30rpx 0;background-color: #FFFFFF;margin-top: 26rpx;border-radius: 16rpx;">
                <view  style="overflow: hidden;" @click="qyxq(item.id,item.special_manage,item.name)">
                  <view style="width: 35%;float: left;position: relative;">
                    <image :src="item.logo_image"
                      style="width: 190rpx;height: 190rpx;display: block;border-radius: 20rpx;"
                      mode=""></image>

                  </view>
                  <view style="width: 65%;float: left;padding: 6rpx 0;">
                    <view style="line-height: 40rpx;color: #010101;font-size: 32rpx;margin: 10rpx 0;"
                      class="yihang">
                      {{item.name}}
                    </view>
                    <view style="line-height: 40rpx;color: #010101;font-size: 32rpx;margin: 10rpx 0;overflow: hidden;">
                      <text v-for="(a,b) in item.client_position_arr" :key='b' style="background: linear-gradient(0deg, #1fb0ac 0%, #5EC4C2 100%);border-radius: 6rpx;color: #FEFEFE;font-size: 22rpx;padding: 0rpx 10rpx;float: left;margin-right: 10rpx;margin-bottom: 10rpx;">
                        {{a.title || ''}}
                      </text>
                    </view>
                    <view style="line-height: 30rpx;color: #999999;font-size: 22rpx;margin: 10rpx 0 20rpx;"
                      class="erhang">
                      生产品类：{{item.process_text || '暂无生产品类'}}
                    </view>
                    <view style="line-height: 30rpx;color: #999999;font-size: 22rpx;" class="erhang">
                      <!-- <text class="iconfont icon-dizhi2"
                        style="color: #909193;font-size: 24rpx;"></text> -->
                      入驻市场：
                      <text v-if="item.bazaar.length>0" v-for="(a,b) in item.bazaar" style="margin-left: 6rpx;" :key='index'>
                        {{a.name}}
                      </text>
                      <text v-if="item.bazaar.length<=0">
                        暂无市场
                      </text>
                    </view>
                  </view>
                </view>
                <view style="display: flex;text-align: center;color: #999999;font-size: 22rpx;line-height: 100rpx;">
                  <view style="flex: 2;text-align: left;">
                    浏览量：{{item.views_num || 0}}
                  </view>
                  <view style="flex: 2;text-align: left;">
                    关注数：{{item.attention_num || 0}}人
                  </view>
                  <view style="flex: 2;">
                    联系次数：{{item.contact_num || 0}}次
                  </view>
                  <view @click="lahei(item.id,index)" style="flex: 1;text-align: right;">
                    <text class="iconfont icon-guanbi" style="font-size: 24rpx;"></text>
                  </view>
                </view>
              </view>
            </view>
            <view style="width:2rpx;height:2rpx;bottom:-2rpx;position:absolute;"></view>
            <view v-if="qiye_kk" style="text-align: center;">
              <image
                src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/e86889a9b8fd67d8950e4775d67316c.png"
                style="width: 400rpx;" mode="widthFix"></image>
            </view>
            <u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
              v-if="qiye_list.length==0"></u-divider>
            <u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
              v-if="qiye_list.length>0 && qiye_enmpy"></u-divider>
          </view>
        </view>
    </scroll-view>
  </view>
</template>

<script>
export default {
  name: 'DongxianCompanyList',
  props: {
    swiperList: {
      type: Array
    }
  },
  data() {
    return {
      qyhyfl_list:[],
      yuan_list_arr6:[],
      list_arr6:[],
    };
  },

  mounted() {

  },

  methods: {
// 企业 推荐 分类
    qy_fl_list() {
      this.yuan_list_arr6=[]
      this.list_arr6=[]
      this.post('api/firm_data/category', '', true).then(res => {
        console.log(res, 123)
        if (res.code == 1) {
          this.qyhyfl_list = res.data
          this.yuan_list_arr6=res.data
          for (let i = 0; i < res.data.length; i++) {
            this.list_arr6.push(res.data[i].name)
          }
          if(res.data.length>10){
            this.fl_xianshi=true
          }
        }
      })
    },
  },
};
</script>